<nav class="navbar navbar-expand-lg navbar-light bg-light shadow-sm my_navbar my-navbar">
    <div class="container">

        <a class="navbar-brand" href="{{route('home')}}">
            <img src="{{asset('images/logo.png')}}" alt="logo" width="30">
            BbsChat
        </a>

        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarSupportedContent">
            <ul class="navbar-nav mr-auto">
                <li class="nav-item">
                    <a class="nav-link" href="#">帖子</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="#">文化</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="#">体育</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="#">旅行</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="#">美食</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="#">历史</a>
                </li>
            </ul>

            <ul class="navbar-nav">
                @guest()
                    <li class="nav-item">
                        <a class="nav-link" href="{{route('login')}}">登录</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{{route('register')}}">注册</a>
                    </li>
                @else
                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-expanded="false">
                            <img src="{{asset('images/logo.png')}}" class="img-thumbnail" alt="avatar" width="30">
                            <span class="ml-2">{{Auth::user()->name}}</span>
                        </a>
                        <div class="dropdown-menu text-center">
                            <a class="dropdown-item" href="{{route('users.show',Auth::user())}}">个人中心</a>
                            <a class="dropdown-item" href="{{route('users.edit',Auth::user())}}">编辑资料</a>
                            <div class="dropdown-divider"></div>

                            <form action="{{route('logout')}}" method="post" onsubmit="return confirm('确认退出账号?')">
                                @csrf
                                <small class="d-flex justify-content-center">
                                    <button class="btn btn-danger btn-sm">退出登录</button>
                                </small>
                            </form>

                        </div>
                    </li>
                @endguest
            </ul>
        </div>
    </div>
</nav>



